//类：可以理解为模板,通过模板可以实例化对象
//面向对象的编程思想
(() => {
    //定义类
    class Person {
        name: string
        age: number
        sex: string
        constructor(name: string, age: number, sex: string) {
            this.name = name
            this.age = age
            this.sex = sex
        }
        sayHi(str: string) {
            console.log(`我叫${this.name},今年${this.age}，性别${this.sex}!${str}`);
        }
    }
    const person = new Person("张三", 18, "男")
    person.sayHi("你叫什么呢？")
})()